package com.spooky.esb;

import java.net.URL;
import java.util.Date;

public enum SupportedType {
	STRING("string", String.class), //
	DATE("date", Date.class), //
	INTEGER("string", Integer.class, int.class), //
	BYTE("byte", Byte.class), //
	DOUBLE("decimal", double.class, Double.class), //
	FLOAT("decimal", float.class, Float.class), //
	LONG("long", long.class, Long.class), //
	SHORT("short", short.class, Short.class), //
	BOOLEAN("boolean", boolean.class, Boolean.class), //
	URI("anyURI", URL.class), //
	;
	private String mType;
	private Class<?>[] mClasses;

	private SupportedType(String type, Class<?>... clazz) {
		mType = type;
		mClasses = clazz;
	}

	public String getType() {
		return mType;
	}

	public Class<?>[] getClasses() {
		return mClasses;
	}

	public boolean compare(Class<?> clazz) {
		for (Class<?> curClass : mClasses) {
			if (curClass.equals(clazz)) {
				return true;
			}
		}
		return false;
	}
}
